home *** CD-ROM | disk | FTP | other *** search
/ Aminet 43 / Aminet 43 (2001)(GTI - Schatztruhe)[!][Jun 2001].iso / Aminet / util / boot / Kill2090.lha / Kill2090 / resetcode.txt < prev    next >
Text File  |  2001-03-06  |  7KB  |  195 lines

  1. Group: comp.sys.amiga.tech, Item 2342   (Current Item Range #2253 - #2365)
  2. Subject: ColdReboot() - The Never Ending Story?
  3. From: rbabel@babylon.UUCP (Ralph Babel)
  4.  
  5. Date: 15 Aug 90 04:55:43 GMT
  6.  
  7. Brief history:
  8.  
  9. The original "ColdReboot()" (new Amiga Hardware Reference
  10. Manual, page 219) didn't work on some (IMHO) broken A2000s
  11. (Kickstart ROM doesn't reappear at location 0 after RESET).
  12.  
  13. The current version (AmigaMail March/April 1990) jumps
  14. directly into Kickstart and therefore doesn't co-operate
  15. with boot-ROMs (not to be confused with Autoboot driver
  16. ROMs) that show up at location 0 after a software RESET
  17. (e.g. it leaves the A1000's WCS write-enabled and does not
  18. work with GVP's '030 boot-ROMs - dunno about A2620/A2630).
  19. Presumably this bug also prevents the current versions of
  20. "MMUKick" and "SetCPU ROMBOOT" from working with boot-ROMs.
  21.  
  22. So what about the following solution?
  23.  
  24. ------------------------ cut here ------------------------
  25.  
  26. * This is Beer-Ware. If you find this program useful, you
  27. * are morally obliged to buy me a drink at the next Amiga
  28. * show or devcon. :-)
  29.  
  30.         csect   "text",0,1,0,4
  31.  
  32.         include "exec/types.i"
  33.         include "exec/execbase.i"
  34.  
  35. AbsExecBase             equ     4
  36. _LVOSupervisor          equ     -30
  37. _LVOColdReboot          equ     -726
  38. LIBRARY_VERSION_2_0     equ     36
  39.  
  40. _ColdReboot
  41.         movea.l AbsExecBase.w,a6
  42.         cmp.w   #LIBRARY_VERSION_2_0,LIB_VERSION(a6)
  43.         blt.b   1$
  44.         jmp     _LVOColdReboot(a6)
  45.  
  46. 1$      lea     2$(pc),a5
  47.         jsr     _LVOSupervisor(a6)
  48.  
  49. *
  50. * in case our boot-ROM doesn't show up at location 0 ...
  51. *
  52. * romsize  equ     $00ffffec
  53. * romend   equ     $01000000
  54. *
  55. * $000002: bra.b   $000008
  56. * $000004: AbsExecBase
  57. * $000008: lea     romend+4,a0
  58. * $00000e: suba.l  romsize-(romend+4)(a0),a0
  59. * $000012: movea.l (a0),a0
  60. * $000014: subq.l  #2,a0
  61. * $000016: jmp     (a0)
  62. *
  63.  
  64. 2$      lea     (2).w,a0
  65.         movea.l a0,a1
  66.         move.w  #$6004,(a1)+
  67.         addq.l  #4,a1
  68.         move.l  #$41f90100,(a1)+
  69.         move.l  #$000491e8,(a1)+
  70.         move.l  #$ffe82050,(a1)+
  71.         move.l  #$55884ed0,(a1)
  72.  
  73.         btst.b  #AFB_68020,AttnFlags+1(a6)
  74.         beq.b   3$
  75.  
  76.         movec.l cacr,d0
  77.         bset.l  #3,d0
  78.         movec.l d0,cacr
  79.  
  80. 3$      cnop    0,4
  81.         reset
  82.         jmp     (a0)
  83.  
  84.         end
  85.  
  86. ------------------------ cut here ------------------------
  87.  
  88. Restrictions: Does not support '040 under pre-2.0; assumes
  89. all boot-ROMs have a JMP-$absolute at location 2; and the
  90. usual MMU restriction (turn off MMU before rebooting). Maybe
  91. Dave has a good idea on how to turn off the MMU without
  92. pulling the rug from under your own feet (SetCPU ROMBOOT)?
  93.  
  94. Comments appreciated,
  95.  
  96. Ralph Babel
  97.  
  98. ....!cbmvax!cbmehq!babylon!rbabel
  99.  
  100.  
  101.  
  102.  
  103. Group: comp.sys.amiga.tech, Item 2349   (Current Item Range #2253 - #2365)
  104. Subject: Re: ColdReboot() - The Never Ending Story?
  105. From: daveh@cbmvax.commodore.com (Dave Haynie), Commodore, West Chester, PA
  106.  
  107. Date: 16 Aug 90 16:32:13 GMT
  108.  
  109. In article <03021.AA03021@babylon.UUCP> rbabel@babylon.UUCP (Ralph Babel) writes
  110.  
  111. :
  112. >Brief history:
  113.  
  114. >The current version (AmigaMail March/April 1990) jumps
  115. >directly into Kickstart and therefore doesn't co-operate
  116. >with boot-ROMs (not to be confused with Autoboot driver
  117. >ROMs) that show up at location 0 after a software RESET
  118. >(e.g. it leaves the A1000's WCS write-enabled and does not
  119. >work with GVP's '030 boot-ROMs - dunno about A2620/A2630).
  120. >Presumably this bug also prevents the current versions of
  121. >"MMUKick" and "SetCPU ROMBOOT" from working with boot-ROMs.
  122.  
  123. I'm  not  sure  what the GVP boot ROMs actually do, but with the A2620 and
  124. A2630,  these  ROMs  are  gone forever by the time you're into AmigaOS the
  125. first  time after a full system reset (eg, powerup, keyboard, or any other
  126. condition  that yanks both RST* and HLT*).  Basically, after a full system
  127. reset,  the  A26x0 ROMs are mapped at 0 and a magic A26x0 control register
  128. is  mapped  into  the  $00e8xxxx space normally used for AUTOCONFIG units.
  129. This  magic control register is similar to, but not identical to, a normal
  130. AUTOCONFIG  unit,  and  Exec  would  certainly  choke  on it.  The control
  131. register  is  actually  at  $00e80040, and it can be written to repeatedly
  132. until  the  configuration bit in the register is set.  At that point, this
  133. magic  control  register  goes  away,  normally until the next full-system
  134. reset.   It  is  replaced  at  $00e8xxxx by the configuration unit for the
  135. A26x0  on-board  memory,  which  is  a  true AUTOCONFIG unit understood by
  136. expansion.library and all.  Any CPU-generated RESET will bring you back to
  137. this  state, but not back to the initial state where the magic register is
  138. accessible or A26x0 ROMs are visible.
  139.  
  140. >Maybe Dave has a good idea on how to turn off the MMU without
  141. >pulling the rug from under your own feet (SetCPU ROMBOOT)?
  142.  
  143. If the MMU is on, make sure you're done running any OS code before you turn 
  144. it off.  That's about all you can do.  For SetCPU ROMBOOT, I do just this.
  145. If you're running under 2.0, SetCPU setfunctions its own reset routine, which
  146. will [a] not live in emulated ROM at the time of reset, and [b] turn off the
  147. MMU just prior to resetting.
  148.  
  149. >Ralph Babel
  150.  
  151. -- 
  152. Dave Haynie Commodore-Amiga (Amiga 3000) "The Crew That Never Rests"
  153.    {uunet|pyramid|rutgers}!cbmvax!daveh      PLINK: hazy     BIX: hazy
  154.       Get that coffee outta my face, put a Margarita in its place!
  155.  
  156.  
  157. Group: comp.sys.amiga.tech, Item 2353   (Current Item Range #2253 - #2365)
  158. Subject: Re: ColdReboot() - The Never Ending Story?
  159. From: valentin@cbmvax.commodore.com (Valentin Pepelea), Commodore, West Chester,
  160.  
  161. Date: 16 Aug 90 20:43:59 GMT
  162.  
  163. In article <03021.AA03021@babylon.UUCP> rbabel@babylon.UUCP (Ralph Babel)
  164. writes:
  165. >
  166. > The original "ColdReboot()" (new Amiga Hardware Reference Manual, page 219)
  167. > didn't work on some (IMHO) broken A2000s (Kickstart ROM doesn't reappear at
  168. > location 0 after RESET).
  169. >
  170. > (e.g. it leaves the A1000's WCS write-enabled and does not work with GVP's
  171. > '030 boot-ROMs - dunno about A2620/A2630). Presumably this bug also prevents
  172. > the current versions of "MMUKick" and "SetCPU ROMBOOT" from working with
  173. > boot-ROMs.
  174.  
  175. I'm  not  sure  what you are talking about here.  I wrote MMUkick with the
  176. specific purpose to allow GVP accelerator owners to boot OS 2.0 kickfiles.
  177. I even had to help GVP find out why initially, MMUkick would not work.  To
  178. fix  that  they  had  to  replace  their PALs with new ones which properly
  179. propagate  the *RESET signal from the CPU to external devices, and did not
  180. inhibit the cache for CPU fetches from chip memory.
  181.  
  182. > So what about the following solution?
  183.  
  184. Self modifying code is dangerous to your health. In this case, remember to
  185. Disable() all interrupts before entering the critical region.
  186.  
  187. Valentin
  188. -- 
  189. The Goddess of democracy? "The tyrants     Name:    Valentin Pepelea
  190. may distroy a statue,  but they cannot     Phone:   (215) 431-9327
  191. kill a god."                               UseNet:  cbmvax!valentin@uunet.uu.net
  192.  
  193.              - Ancient Chinese Proverb     Claimer: I not Commodore spokesman be
  194.  
  195.